package com.example.Windturbine.Config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


/**
 * @Author 丁永新
 * @Date 2021/12/12
 */

@Configuration
@EnableWebMvc
public class MvcConfig implements WebMvcConfigurer {

    //拦截掉/favicon.ico /injection.js不做处理
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        WebMvcConfigurer.super.addInterceptors(registry);
        registry.addInterceptor(new TestInterceptorConfig()).addPathPatterns("/**")
                .excludePathPatterns("/favicon.ico","/injection.js");
    }

}